package com.itheima.mapper;

import com.itheima.pojo.Brand;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BrandMapper {
    // 查询所有的品牌
    @Select("select id, brand_name as brandName, company_name as companyName, ordered, description, status\n" +
            "from tb_brand " +
            "order by id desc")
    List<Brand> selectAll();

    /**
     * 添加品牌
     * @param brand 品牌数据
     * @return 影响的行数
     */
    @Insert("insert into tb_brand( brand_name, company_name, ordered, description, status)\n" +
            "values(#{brandName},#{companyName},#{ordered},#{description},#{status})")
    Integer insert(Brand brand);


}
